package cn.bugstack.infrastructure.dao;

import cn.bugstack.infrastructure.dao.po.RaffleActivityAccountDay;
import cn.bugstack.middleware.db.router.annotation.DBRouter;
import org.apache.ibatis.annotations.Mapper;

/**
 * @author Fuzhengwei bugstack.cn @小傅哥
 * @description 抽奖活动账户表-日次数
 * @create 2024-04-03 15:56
 */
@Mapper
public interface IRaffleActivityAccountDayDao {

    /**
     * 查询抽奖活动账户表-日次数记录
     * @param raffleActivityAccountDayReq 抽奖活动账户表-日次数对象
     * @return 抽奖活动账户表-日次数对象
     */
    @DBRouter(key = "userId")
    RaffleActivityAccountDay queryActivityAccountDayByUserId(RaffleActivityAccountDay raffleActivityAccountDayReq);

    /**
     * 插入抽奖活动账户表-日次数记录
     * @param raffleActivityAccountDayReq 抽奖活动账户表-日次数对象
     */
    @DBRouter(key = "userId")
    void insertActivityAccountDay(RaffleActivityAccountDay raffleActivityAccountDayReq);

    /**
     * 更新抽奖活动账户表-日次数记录
     * @param raffleActivityAccountDayReq 抽奖活动账户表-日次数对象
     * @return 更新的行数
     */
    @DBRouter(key = "userId")
    int updateActivityAccountDaySubstractionQuota(RaffleActivityAccountDay raffleActivityAccountDayReq);

    /**
     * 查询当天抽奖次数
     * @param raffleActivityAccountDay 抽奖活动账户表-日次数
     * @return 当天抽奖次数
     */
    @DBRouter(key = "userId")
    Integer queryRaffleActivityAccountDayPartakeCount(RaffleActivityAccountDay raffleActivityAccountDay);

    /**
     * 更新日活动额度账户
     * @param raffleActivityAccountDay 抽奖活动账户表-日次数
     */
    void addAccountQuota(RaffleActivityAccountDay raffleActivityAccountDay);
}
